

@RestController
@RequestMapping("/umsRole")
public class UmsRoleController {

    @Resource
    private UmsRoleService umsRoleService;


    /**
     * 获取 UmsRole 分页列表
     */
    @GetMapping("/pagination")
    public Ret getUmsRolePagination( PaginationVo paginationVo, UmsRoleQuery umsRoleQuery ) throws Exception {
        IPage page = umsRoleService.getUmsRolePagination(paginationVo, umsRoleQuery );
        return Ret.toPage(page);
    }


    /**
     * 获取 UmsRole 所有数据
     */
    @GetMapping("/all")
    public Ret getUmsRoleAllList( UmsRoleQuery umsRoleQuery ) throws Exception {
        List<UmsRoleEntity> list = umsRoleService.getUmsRoleAllList( umsRoleQuery );
        return Ret.ok(list);
    }



    /**
     * 获取 UmsRole 详情
    */
   @GetMapping("/{id}")
   public Ret getUmsRoleDetail(@PathVariable Long id) throws Exception {

       UmsRoleEntity umsRole = umsRoleService.getUmsRoleDetail(id);
       return Ret.ok(umsRole);
   }


    /**
     * 新增 UmsRole
     * */
    @PostMapping("")
    public Ret addUmsRole(@RequestBody UmsRoleVo umsRoleVo) throws Exception {

        umsRoleService.addUmsRole(umsRoleVo);
        return Ret.ok();
    }


    /**
     * 更新 UmsRole
     * */
    @PutMapping("")
    public Ret updateUmsRole(@RequestBody UmsRoleVo umsRoleVo) throws Exception {

        umsRoleService.updateUmsRole(umsRoleVo);
        return Ret.ok();
    }


    /**
     * 删除 UmsRole
     * */
    @PostMapping("/batchRemove")
    public Ret batchRemoveUmsRole( @RequestBody List<Long> ids ) throws Exception {

        umsRoleService.batchRemoveUmsRole(ids);
        return Ret.ok();
    }
}

  